.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.title {
  font-size: 1.8rem;
  color: #333;
  margin: 0;
}

.cancelBtn {
  padding: 0.4rem 0.8rem;
  margin: 0px 20px;
  background-color: #817f7f;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.sectionTitle {
  font-size: 1.4rem;
  color: #444;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #0070f3;
  display: inline-block;
}

.postsSection {
  margin-bottom: 3rem;
}

.postsList {
  display: grid;
  gap: 1.5rem;
}

.postItem {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #eee;
  border-radius: 8px;
  transition: box-shadow 0.2s;
}

.postItem:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.postImage {
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
}

.image {
  object-fit: cover;
}

.postInfo {
  flex-grow: 1;
}

.postTitle {
  margin: 0 0 0.5rem 0;
  font-size: 1.2rem;
  color: #333;
}

.postDesc {
  margin: 0;
  color: #666;
  font-size: 0.9rem;
}

.deleteBtn {
  padding: 0.4rem 0.8rem;
  background-color: #ef4444;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.deleteBtn:hover {
  background-color: #dc2626;
}

.formSection {
  background-color: #f9f9f9;
  padding: 1.5rem;
  border-radius: 8px;
}

.postForm {
  display: grid;
  gap: 1rem;
}

.formGroup {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input {
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.textarea {
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  resize: vertical;
}

.submitBtn {
  padding: 0.8rem 1.5rem;
  background-color: #0070f3;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.submitBtn:hover {
  background-color: #0051aa;
}

.loading {
  color: #666;
  padding: 2rem;
  text-align: center;
}

.error {
  color: #dc2626;
  padding: 2rem;
  text-align: center;
}

.emptyState {
  color: #666;
  padding: 2rem;
  text-align: center;
  background-color: #f5f5f5;
  border-radius: 8px;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.pageTitle {
  text-align: center;
  margin-bottom: 2rem;
  color: #333;
}

/* 分栏布局 */
.layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  /* 左侧文章列表，右侧固定宽度表单 */
  gap: 2rem;
  height: calc(100vh - 120px);
  /* 减去标题和padding高度 */
}

/* 文章列表区域（左侧） */
.postsSection {
  overflow-y: auto;
  /* 文章过多时滚动 */
  padding-right: 1rem;
}

.postsList {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.postItem {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #eee;
  border-radius: 8px;
  transition: all 0.2s;
}

.postItem:hover {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

.postImage {
  flex-shrink: 0;
  width: 120px;
  height: 80px;
  overflow: hidden;
  border-radius: 4px;
  background-color: #f5f5f5;
}

.image {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.postInfo {
  flex-grow: 1;
  min-width: 0;
  /* 解决文本溢出 */
}

.postTitle {
  margin: 0 0 0.3rem 0;
  font-size: 1.1rem;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.postDesc {
  margin: 0;
  color: #666;
  font-size: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.deleteBtn {
  padding: 0.4rem 0.8rem;
  background-color: #ef4444;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.deleteBtn:hover {
  background-color: #dc2626;
}

/* 发布表单区域（右侧固定） */
.formSection {
  position: sticky;
  top: 2rem;
  align-self: start;
  background-color: #f9f9f9;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* 表单样式 */
.postForm {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.formGroup {
  width: 100%;
}

.input {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.input:focus {
  border-color: #0070f3;
  outline: none;
}

.textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  resize: vertical;
  min-height: 120px;
}

.textarea:focus {
  border-color: #0070f3;
  outline: none;
}

.submitBtn {
  padding: 0.8rem 1.5rem;
  background-color: #0070f3;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.submitBtn:hover {
  background-color: #0051aa;
}

/* 图片上传样式 */
.imageLabel {
  display: block;
  cursor: pointer;
}

.uploadArea {
  width: 100%;
  height: 120px;
  border: 2px dashed #ddd;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  transition: all 0.2s;
}

.uploadArea:hover {
  border-color: #0070f3;
  color: #0070f3;
}

.previewContainer {
  position: relative;
  width: 100%;
  height: 120px;
  border-radius: 4px;
  overflow: hidden;
}

.previewImage {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.changeText {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.3rem;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 0.8rem;
  text-align: center;
}

.fileInput {
  display: none;
  /* 隐藏原生文件输入框 */
}

/* 状态提示样式 */
.loading {
  color: #666;
  padding: 2rem;
  text-align: center;
}

.error {
  color: #dc2626;
  padding: 2rem;
  text-align: center;
}

.emptyState {
  color: #666;
  padding: 2rem;
  text-align: center;
  background-color: #f5f5f5;
  border-radius: 8px;
}

.sectionTitle {
  font-size: 1.3rem;
  color: #444;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #0070f3;
  display: inline-block;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
    /* 移动端单栏布局 */
    height: auto;
  }

  .postsSection {
    overflow-y: visible;
  }
}